@extends('layout')
@section('content')
<div class="panel panel-success">
      <div class="panel-heading">
      <h3><left><a href = "/potreros"><a class="glyphicon glyphicon-log-in text-success"><a class="glyphicon glyphicon-list text-success"></a></left>Ganado asociado al Potrero</h3>
      </div>
    </div>
  <div class="panel panel-success">
      <div class="panel-body">
        <table class="table table-hover">
        <thead>
          <tr>
            <Th> ID Potrero-Ganado </ th>
           <Th> # Ganado </ th>
                <Th> Estado </ th>
                  <th>Acciones</th>
        </thead>
        <tbody>
          @foreach($potrero as $potrerog)
            <tr>
            <td> {{$potrerog->id_potrero}} </td>       
            <td>
              @foreach($ganado as $gan)
                    @if($potrerog->id_ganado == $gan->id)
                    {{$gan->cod_ganado}} 
                    @endif
                  @endforeach
           </td>        
                      <td>
            @if ($potrerog->activo == 0) 
                              <p>Inactivo</p> 
                              @else 
                                 <p>  activo</p> 
                                    @endif    </td>  
                                               <td> 
           <a>{{ Form::open(array('url' => 'ganadopotrero/'.$potrerog->id, 'method'=> 'delete')) }}
               {{ Form::submit('Desasociar',  array('class' => "btn btn-danger"))}}
               {{ Form::close() }}</a>
            </td>
                     </tr>
          @endforeach
                </tbody>
      </table>
      </div>
        <div class="modal-footer">
              <a href="{{URL::to('potreros')}}" class="btn btn-success" data-dismiss="modal">Regresar</a>
        </div>
    </div>
    </div>
    
@stop